Release 10.1A: OpenEdge Deployment:
Managing 4GL Applications
Using an output-routing table
More complex output-routing schemes, such as routing output based on the user ID, require the creation of several related Progress 4GL tables and an include file that can access these tables and select the proper output command for the particular user.
Just as you can use Progress 4GL tables (
_User) to set up security for OpenEdge applications, you can also use Progress 4GL tables for output routing. If you want to route application output to different printers based on user ID, set up a table in the application database containing each of the valid user IDs and the corresponding print commands.Figure 7–3 shows a sample output-routing table.
Figure 7–3: Sample output-routing table
![]()
The database table shown in the figure contains records that have a userid field and an outdev field containing an operating system output device. The userid field is a unique primary index for the table. You have to keep the Usrprnt table up to date with a record for each new user on your system.
After setting up the database table, create an include file that determines the current user ID and then searches the Usrprnt table for a matching user ID and corresponding output device. For example:
The include file searches the Usrprnt table for a record that has a user ID that matches the user ID established for the current application session. If there is no user ID match or established user ID for the application session, OpenEdge uses the default system printer. If there is a match, OpenEdge sends the application output to the output device contained in the corresponding outdev field.
The
VALUEoption of theOUTPUT THROUGHstatement allows you to designate a substitutable output device. TheUSERIDfunction allows you to capture system user IDs on UNIX. For more information about the_Usertable, see OpenEdge Data Management: Database Administration .After creating an include file to route application output, replace all
OUTPUTstatements in your application with the include file. For example:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |